package oj;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Day16F {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int count=0;
        List<Integer> list;
        for (int i = 2; i <= n; i++) {
            list=fun(i);
            if(com(list,i)){
                count++;
            }
        }
        System.out.println(count);
    }

    public static List<Integer> fun(int num){
        List<Integer> list=new ArrayList<>();
        for (int i = 1; i * i <= num ; i++) {
            if(num%i==0){
                list.add(i);
                if(num/i!=i && num/i!=num){
                    list.add(num/i);
                }
            }
        }
        return list;
    }
    public static boolean com(List<Integer> list,int num){
        int ret=0;
        for(int j:list){
            ret+=j;
        }
        if(ret==num){
            return true;
        }
        return false;
    }
}
